{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>机构审核</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal" name="userAdd" id="userAdd" >
                        <input type="hidden" name="id" value="{$info.mechanism_id}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">机构代码：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_code" type="text" class="form-control" name="mechanism_code" value="{$info.mechanism_code}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">机构名称：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_name" type="text" class="form-control" name="mechanism_name" value="{$info.mechanism_name}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">机构logo：</label>
                            <div class="input-group col-sm-5">
                                <img id="img_data" height="100px" style="float:left;margin-left: 50px;margin-top: -10px;cursor:pointer;" src="{$info.mechanism_logo}" onclick='imgDisplay(this)'/>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">所在省份：</label>
                            <div class="input-group col-sm-4">
                                <input id="province" type="text" class="form-control" name="province" value="{$info.province}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">所在城市：</label>
                            <div class="input-group col-sm-4">
                                <input id="city" type="text" class="form-control" name="city" value="{$info.city}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">所在地区：</label>
                            <div class="input-group col-sm-4">
                                <input id="district" type="text" class="form-control" name="district" value="{$info.district}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上级机构：</label>
                            <div class="input-group col-sm-4">
                                <input id="parent_name" type="text" class="form-control" name="parent_name" value="{$info.parent_name}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">申请人：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_member_name" type="text" class="form-control" name="mechanism_member_name" value="{$info.mechanism_member_name}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系电话：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_phone" type="text" class="form-control" name="mechanism_phone" value="{$info.mechanism_phone}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">组织地址：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_address" type="text" class="form-control" name="mechanism_address" value="{$info.mechanism_address}" disabled>

                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">注册号：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_create_code" type="text" class="form-control" name="mechanism_create_code" value="{$info.mechanism_create_code}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">注册日期：</label>
                            <div class="input-group col-sm-4">
                                <input id="mechanism_create_time" type="text" class="form-control" name="mechanism_create_time" value="{$info.mechanism_create_time}" disabled>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="form-group">
                                <label class="col-sm-3 control-label cyanse" >机构简介：</label>
                                <div class="input-group col-sm-5">
                                    <textarea name="content" class="form-control" rows="3" type="text" disabled>{$info.mechanism_intro}</textarea>
                                </div>
                            </div>
                        </div>
                        {if $info.mechanism_status==1}
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">审核结果：</label>
                            <div class="layui-input-block">
                                <label><input type="radio" name="mechanism_status" value="2" id="allow" checked>通过&nbsp;</label>
                                <label><input type="radio" name="mechanism_status" value="3" id="reject" >驳回</label>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">驳回理由：</label>
                            <div class="layui-input-block">
                                <textarea name="mechanism_false_reason" id="reason" cols="30" rows="10" disabled></textarea>
                            </div>
                        </div>
                        {/if}
                        {if $info.mechanism_status==3}
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">驳回理由：</label>
                            <div class="layui-input-block">
                                <textarea name="mechanism_false_reason" id="" cols="30" rows="10" disabled>{$info.mechanism_false_reason}</textarea>
                            </div>
                        </div>
                        {/if}
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                {if $info.mechanism_status==1}
                                <button class="btn btn-primary btsave" type="submit"><i class="fa fa-save"></i> 审核</button>&nbsp;&nbsp;&nbsp;
                                {/if}
                                <a class="btn btn-danger" href="javascript:history.go(-1);"><i class="fa fa-close"></i> 返回</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
{include file="public/footer" /}

<script type="text/javascript" src="__JS__/Crop.js"></script>
<script type="text/javascript">
    wk.upload("{:url('Upload/upload')}",2);


    //百度富文本编辑器
//    var editor = UE.getEditor('myEditor', {
//        initialFrameHeight:450,
//        autoHeight: false,
//        autoHeightEnabled:false,
//        autoFloatEnabled:false
//    });

    $.validator.setDefaults({
        highlight: function(e) {
            $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
            $(e).closest(".form-control").css("color","#737373");
        },
        success: function(e) {
            // e.closest(".form-group").removeClass("has-error").addClass("has-success")
            $(e).closest(".form-group").removeClass("has-error");
        },
        errorElement: "span",
        errorPlacement: function(e, r) {
            e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
            if(r.is("#groupid")){
                e.appendTo(r.parent());
            }
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"
    }), $().ready(function() {
        var e = "<i class='fa fa-times-circle'></i> ";
        $("#userAdd").validate({
            submitHandler: function(form) {
//                $('button').attr('disabled', 'disabled');
                $.ajax({
                    url: "{:url('mechanismaudit')}",
                    type: "post",
                    dataType: "json",
                    data: $("#userAdd").serialize(),
                    success: function (data) {
                        if (data.code == 200) {
                            wk.success(data.msg,1,"{:url('Mechanism/index')}");
                        } else {
                            $('button').removeAttr('disabled');
                            wk.error(data.msg,2,'');
                            return false;
                        }
                    }
                });
            },
        })
    });
    //选择未认证、已认证
    $(document).on('click', '#allow', function(){
        $('#reason').attr('disabled',true);
        $("#reason").trigger("chosen:updated");
    })
    $(document).on('click', '#reject', function(){
        $('#reason').attr('disabled',false);
        $("#reason").trigger("chosen:updated");
    })


</script>
</body>
</html>